package com.mmz.spring.aop;



public class EmptyTargetSource implements TargetSource {

	public static final EmptyTargetSource INSTANCE = new EmptyTargetSource(null, true);
	
	private final Class<?> targetClass;

	private final boolean isStatic;
	
	private EmptyTargetSource(Class<?> targetClass, boolean isStatic) {
		this.targetClass = targetClass;
		this.isStatic = isStatic;
	}
	
	public static EmptyTargetSource forClass(Class<?> targetClass) {
		return forClass(targetClass, true);
	}

	/**
	 * Return an EmptyTargetSource for the given target Class.
	 * @param targetClass the target Class (may be {@code null})
	 * @param isStatic whether the TargetSource should be marked as static
	 * @see #getTargetClass()
	 */
	public static EmptyTargetSource forClass(Class<?> targetClass, boolean isStatic) {
		return (targetClass == null && isStatic ? INSTANCE : new EmptyTargetSource(targetClass, isStatic));
	}
	
	public Class<?> getTargetClass() {
		// TODO Auto-generated method stub
		return this.targetClass;
	}

	public boolean isStatic() {
		// TODO Auto-generated method stub
		return this.isStatic;
	}

	public Object getTarget() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	public void releaseTarget(Object target) throws Exception {
		// TODO Auto-generated method stub

	}

}
